package org.ishequ.app;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class PhoneActivity extends Activity {
    private EditText phoneNumText;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button phoneBtn = (Button)findViewById(R.id.btnId);
        phoneNumText = (EditText)findViewById(R.id.btnTextId);
        phoneBtn.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				String phoneNum = phoneNumText.getText().toString();
				Intent intent = new Intent();
				intent.setAction("android.intent.action.CALL");
//				intent.addCategory("android.intent.category.DEFAULT");
				intent.setData(Uri.parse("tel:"+phoneNum));
				startActivity(intent);
			}
        });
    } 
}